package com.example.hf_v1.controller;


import com.example.hf_v1.config.Result;
import com.example.hf_v1.entity.Hairstyleattributes;
import com.example.hf_v1.service.IHairstyleattributesService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 发型属性
 前端控制器
 * </p>
 *
 * @author 浪花骑士
 * @since 2024-08-07
 */
@RestController
@RequestMapping("/hairstyleattributes")
public class HairstyleattributesController {

    @Resource
    private IHairstyleattributesService iHairstyleattributesService;

    //增加发型属性
    @RequestMapping("/addHairstyleAttributes")
    public Result addHairstyleAttributes(@RequestBody Hairstyleattributes hairstyleAttributes) {
        return Result.success(iHairstyleattributesService.save(hairstyleAttributes));
    }

    //删除发型属性
    @RequestMapping("/deleteHairstyleAttributes")
    public Result deleteHairstyleAttributes(Integer id) {
        return Result.success(iHairstyleattributesService.removeById(id));
    }

    //修改发型属性
    @RequestMapping("/updateHairstyleAttributes")
    public Result updateHairstyleAttributes(@RequestBody Hairstyleattributes hairstyleAttributes) {
        return Result.success(iHairstyleattributesService.updateById(hairstyleAttributes));
    }

    //查询所有发型属性
    @RequestMapping("/selectAllHairstyleAttributes")
    public Result selectAllHairstyleAttributes() {
        return Result.success(iHairstyleattributesService.list());
    }

}
